package com.example.muchentuner.metro;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MyViewModel extends ViewModel {
    public final MutableLiveData<SoundNum> mUserLiveData = new MutableLiveData<SoundNum>();

    public MyViewModel(){
        mUserLiveData.postValue(new SoundNum(1));
    }

    public void setSoundNum(SoundNum soundNumber){
        SoundNum soundNum = mUserLiveData.getValue();
        if (soundNum != null){
            soundNum= soundNumber;
            mUserLiveData.setValue(soundNum);
        }
    }
    public int getSoundNum(SoundNum soundNumber){
        SoundNum soundNum = mUserLiveData.getValue();
        return soundNum.getSoundNum();
    }

    public LiveData<SoundNum> getSelectMusic() {
        return mUserLiveData;
    }
}
